#!/bin/bash
set -e

source $(dirname $0)/version

cd $(dirname $0)/..

mkdir -p dist/artifacts
cp bin/telemetry-${ARCH} bin/telemetry
cp bin/telemetry-${ARCH} dist/artifacts/

IMAGE=${REPO}/telemetry:${TAG}-${ARCH}
DOCKERFILE=package/Dockerfile
if [ -e ${DOCKERFILE}.${ARCH} ]; then
    DOCKERFILE=${DOCKERFILE}.${ARCH}
fi

docker build -f ${DOCKERFILE} -t ${IMAGE} .
echo Built ${IMAGE}
